import { createRouter, createWebHistory}  from  'vue-router'
import routes from "./routes"
const routerHistory = createWebHistory()
//1、获取路由Path
//2、处理成component路由表
//3、添加到路由中
const router = createRouter({
    history: routerHistory,
    routes: routes
})
router.beforeEach(async (to, from, next) => {
    console.log(">>>>>>>>beforeEach")
    next();
})
router.afterEach((to, from) => {
    console.log(">>>>>>>>afterEach")
})
router.onError((error) => {
    console.log(">>>>>>>>onError")
})
export default router